<div class="col-12 clearfix">
  <div class="col-12 col-md-5 float-left pr-md-3">
    <div class="box mb-3">
      <div class="box-header">
        <h3 class="box-title"><%= t(".Tools") %></h3>
      </div>
      <div class="box-row">
        <a href="<%= admin_settings_path %>" target="_blank" class="btn mb-2"><%= icon_tag("gear") %> <%= t(".Settings") %></a>
        <a href="/admin/sidekiq" target="_blank" class="btn mb-2"><%= icon_tag("server") %> <%= t(".Background Jobs") %></a>
        <a href="/admin/pghero" target="_blank" class="btn mb-2"><%= icon_tag("dashboard") %> <%= t(".Database Stats") %></a>
      </div>
      <div class="box-row">
        <a href="<%= edit_admin_integration_path(id: :jira) %>" class="btn mb-2"><%= t(".Integrations") %></a>
      </div>
      <div class="box-row">
        <a href="<%= reindex_admin_dashboard_path %>" data-method="post" class="btn mb-2"><%= t(".Rebuild Search Index") %></a>
      </div>
      <div class="box-row">
        <%= form_tag(exception_track.export_logs_path, method: 'post', style: "display: inline") do %>
          <button type="submit" class="btn mb-2"><%= t(".Export Exceptions") %></button>
        <% end %>
        <a href="/admin/exception-track" target="_blank" class="btn mb-2"><%= icon_tag("error") %> <%= t(".Exceptions") %></a>
      </div>
    </div>

    <%= render "license" %>
  </div>

  <div class="col-12 col-md-7 float-left">
    <div class="box mb-3">
      <div class="box-header">
        <h3 class="box-title"><%= t(".Service statuses") %></h3>
      </div>
      <ul>
        <% @statuses[:results].each do |status| %>
         <li class="box-row clearfix">
           <div><span class="name"><%= t(".Service.#{status[:name]}")  %></span>
           <span class="float-right <%= status[:status].downcase == "error" ? "text-red" : "text-green" %>"><%= status[:status] %></span></div>
           <div class="message text-red">
             <%= status[:message] %>
           </div>
         </li>
         <% end %>
      </ul>
    </div>
  </div>
</div>

<div class="box mb-3">
  <div class="box-header">
    <h3 class="box-title"><%= t(".Statistics") %></h3>
  </div>

  <div class="box-row clearfix">
    <div class="clearfix border-bottom text-center">
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= User.where(type: "User").count %></h2>
        <div class="text-gray-dark"><%= t("admin.User") %></div>
      </div>
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= Group.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Group") %></div>
      </div>
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= Repository.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Repository") %></div>
      </div>
    </div>
    <div class="clearfix text-center">
      <div class="col-3 float-left p-4">
        <h2 class="text-blue"><%= Doc.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Doc") %></div>
      </div>
      <div class="col-3 float-left p-4">
        <h2 class="text-blue"><%= Note.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Note") %></div>
      </div>
      <div class="col-3 float-left p-4">
        <h2 class="text-blue"><%= Issue.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Issue") %></div>
      </div>
      <div class="col-3 float-left p-4">
        <h2 class="text-blue"><%= Comment.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Comment") %></div>
      </div>
    </div>
    <div class="clearfix text-center">
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= Share.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Share") %></div>
      </div>
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= Notification.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Notification") %></div>
      </div>
      <div class="col-4 float-left p-4">
        <h2 class="text-blue"><%= Activity.count %></h2>
        <div class="text-gray-dark"><%= t("admin.Activity") %></div>
      </div>
    </div>
  </div>
</div>
